<template>
  <div>
    <el-brand></el-brand>
    <el-button class="btn" plain size="small" type="primary" @click="add">添加</el-button>
    <!-- 列表 -->
    <v-list @edit='edit'></v-list>
    <!-- 弹框 -->
    <v-dialog ref="dialogInfo" @cancel='cancel' :info = 'info'></v-dialog>
  </div>
</template>

<script>
import vList from "./list.vue";
import vDialog from "./dialog.vue";
export default {
  data() {
    return {
        info:{
            isShow:false,
            isAdd:true
        }
    };
  },
  components: {
    vList,
    vDialog
  },
  methods: {
      add(){
          this.info.isShow= true
          this.info.isAdd= true
      },
      edit(e){
          this.info.isShow=true
          this.info.isAdd=false
          this.$refs.dialogInfo.lookup(e)
      },
      cancel(e){
          this.info.isShow=e
      }
  },
};
</script>

<style  scoped>
.btn {
  margin: 30px;
}
</style>
